
var map = new BMap.Map('cluster',{minZoom:13,maxZoom:18,enableMapClick:false});
//map.centerAndZoom(new BMap.Point(116.404, 39.915),6);
//map.enableScrollWheelZoom();
map.disableDoubleClickZoom();
function disableScroll (map) {
    map.disableScrollWheelZoom()
}
function endisableScroll (map) {
    map.enableScrollWheelZoom()
}

var cluster = "/Map/clusterDate",//行政区数据接口
    Community = "searchCommunityDate",//小区数据接口
    searchEstate = "/map/searchEstateDate",//楼栋数据接口
    allAreaResult;
//请求接口
function clusterDate (url,zone_number) {
    $.ajax({
        type: "post",
        url: url,
        data:zone_number,
        async: false,
        success:function (data) {
            allAreaResult = data.result;
        }
    })
};

//添加市区覆盖物
var flag;
function createCluste (zoneNumber) {
    clusterDate(cluster,zoneNumber);
    allAreaResult.forEach(function (data) {
        //自定义覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            div.style.color = "white";
            div.style.height = "80px";
            div.style.width = "80px";
            div.style.lineHeight = "62px";
            div.style.opacity = '0.9';
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            if(parseInt(this._num) < 300){
                div.style.backgroundColor = "#79ecd6";
            }else if(parseInt(this._num) >= 300 && parseInt(this._num) < 500) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(parseInt(this._num) >= 500 && parseInt(this._num) < 700) {
                div.style.backgroundColor = "#33c3a7";
            }else if(parseInt(this._num) > 700) {
                div.style.backgroundColor = "#26b095";
            }
            var span = this._span = document.createElement("span");
            div.appendChild(span);
            span.appendChild(document.createTextNode(this._text));
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.position = "absolute";
            arrow.style.width = "11px";
            arrow.style.height = "10px";
            arrow.style.top = "22px";
            arrow.style.left = "29%";
            div.appendChild(arrow);
            arrow.appendChild(document.createTextNode(this._num));
            var ply = [];
            var status;
            div.onmouseenter = function(){
                //pay = [];
                status = true;
                this.style.backgroundColor = "#e84a01";
                var bdary = new BMap.Boundary();

                bdary.get(data.name, function(rs){       //获取行政区域
                    //map.removeOverlay(ply);
                    var count = rs.boundaries.length; //行政区域的点有多少个
                    if (count === 0) {
                        alert('未能获取当前输入行政区域');
                        return ;
                    }
                    var pointArray = [];
                    for (var i = 0; i < count; i++) {
                        var p = new BMap.Polygon(rs.boundaries[i],  {strokeColor:"#e84a01", strokeWeight:4, strokeOpacity:0.0, fillOpacity: 0.0, fillColor: "none"}); //建立多边形覆盖物
                        if(status == true){
                            map.addOverlay(p);  //添加覆盖物
                        }

                        pointArray = pointArray.concat(p.getPath());
                        ply.push(p)
                    }
                });
            };
            div.onmouseleave = function(){
                if(parseInt(this.children[1].innerText) < 300){
                    div.style.backgroundColor = "#79ecd6";
                }else if(parseInt(this.children[1].innerText) >= 300 && parseInt(this.children[1].innerText) < 500) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(parseInt(this.children[1].innerText) >= 500 && parseInt(this.children[1].innerText) < 700) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                status = false;
                var p;
                while(p = ply.pop()){
                    map.removeOverlay(p);
                }
            };
            div.onclick = function() {
                flag = true;
                map.clearOverlays();
                //map.removeOverlay();
                map.centerAndZoom(new BMap.Point(data.lng, data.lat),16);
                var zone_number = {zoneNumber:data.zone_number};
                clusterDate(Community,zone_number);
                allAreaResult.forEach(function (Community) {
                    //自定义小区覆盖物
                    function ComplexCustomOverlay(point, text,num){
                        this._point = point;
                        this._text = text;
                        this._num = num;
                    }
                    ComplexCustomOverlay.prototype = new BMap.Overlay();
                    ComplexCustomOverlay.prototype.initialize = function(map){
                        this._map = map;
                        var div = this._div = document.createElement("div");
                        div.style.position = "absolute";
                        div.style.backgroundColor = "#26b095";
                        div.style.color = "white";
                        div.style.height = "60px";
                        div.style.width = "60px";
                        div.style.textAlign = "center";
                        div.style.borderRadius = "50%";
                        div.style.whiteSpace = "nowrap";
                        div.style.MozUserSelect = "none";
                        div.style.fontSize = "12px";
                        div.style.cursor = "pointer";
                        div.style.zIndex = "-11";
                        if(this._num < 5){
                            div.style.backgroundColor = "#79ecd6";
                        }else if(this._num >= 5 && this._num < 10) {
                            div.style.backgroundColor = "#4cdcc0";
                        }else if(this._num >= 10 && this._num < 15) {
                            div.style.backgroundColor = "#33c3a7";
                        }else {
                            div.style.backgroundColor = "#26b095";
                        }
                        var cont = document.createElement("div");
                        cont.style.marginTop = "20%";
                        var span = this._span = document.createElement("p");
                        span.appendChild(document.createTextNode("笔"));
                        span.style.margin = "0";
                        //var that = this;
                        var arrow = this._arrow = document.createElement("p");
                        arrow.style.left = "17px";
                        arrow.style.margin = "0";
                        cont.appendChild(arrow);
                        cont.appendChild(span);
                        div.appendChild(cont);
                        var message = document.createElement("div");
                        message.style.width = "160px";
                        message.style.height = "50px";
                        message.style.background = "#FFFFFF";
                        message.style.opacity = ".8";
                        message.style.borderTopRightRadius = "25px";
                        message.style.borderBottomRightRadius = "25px";
                        message.style.position = "absolute";
                        message.style.top = "5px";
                        message.style.color = "#666666";
                        message.style.lineHeight = "50px";
                        message.style.display = "none";
                        message.style.textAlign = "center";
                        message.style.border = "1px solid #e84a01";
                        message.style.boxSizing = "border-box";
                        message.style.left = "40px";
                        message.style.fontSize = "14px";
                        message.style.boxShadow = "0 0 6px #092923";
                        message.appendChild(document.createTextNode(this._text));
                        div.appendChild(message);
                        arrow.appendChild(document.createTextNode(this._num));

                        div.onmouseenter = function(){
                            this.style.backgroundColor = "#e84a01";
                            message.style.display = "block";
                            this.style.zIndex = "auto";
                            message.style.zIndex = "-10";
                        };
                        div.onmouseleave = function(){
                            //this.style.backgroundColor = "#26b095";
                            if(this.children[0].children[0].innerText < 5){
                                div.style.backgroundColor = "#79ecd6";
                            }else if(this.children[0].children[0].innerText >= 5 && this.children[0].children[0].innerText < 10) {
                                div.style.backgroundColor = "#4cdcc0";
                            }else if(this.children[0].children[0].innerText >= 10 && this.children[0].children[0].innerText < 15) {
                                div.style.backgroundColor = "#33c3a7";
                            }else {
                                div.style.backgroundColor = "#26b095";
                            }
                            this.style.zIndex = "-11";
                            message.style.display = "none";
                        };
                        div.onclick = function() {
                            map.clearOverlays();
                            //map.removeOverlay();
                            map.centerAndZoom(new BMap.Point(Community.lng, Community.lat),18);
                            var communityId = {communityId:Community.communityid};
                            clusterDate(searchEstate,communityId);
                            allAreaResult.forEach(function (searchEstate) {
                                //自定义楼栋覆盖物
                                function ComplexCustomOverlay(point,num){
                                    this._point = point;
                                    this._num = num;
                                }
                                ComplexCustomOverlay.prototype = new BMap.Overlay();
                                ComplexCustomOverlay.prototype.initialize = function(map){
                                    this._map = map;
                                    var div = this._div = document.createElement("div");
                                    div.style.position = "absolute";
                                    div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
                                    div.style.backgroundColor = "#26b095";
                                    div.style.color = "white";
                                    div.style.height = "30px";
                                    div.style.lineHeight = "18px";
                                    div.style.opacity = '0.9';
                                    div.style.textAlign = "center";
                                    div.style.borderRadius = "4px";
                                    div.style.whiteSpace = "nowrap";
                                    div.style.MozUserSelect = "none";
                                    div.style.fontSize = "12px";
                                    div.style.cursor = "pointer";
                                    div.style.padding = "6px";
                                    div.appendChild(document.createTextNode(this._num));
                                    var sj = this._p = document.createElement("p");
                                    sj.style.position = "absolute";
                                    sj.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
                                    sj.style.width = 0;
                                    sj.style.height = 0;
                                    sj.style.borderTop = "10px solid #26b095";
                                    sj.style.borderLeft = "10px solid transparent";
                                    sj.style.borderRight = "10px solid transparent";
                                    sj.style.bottom = "-20px";
                                    sj.style.left = "25%";
                                    div.appendChild(sj);
                                    div.onmouseenter = function(){
                                        this.style.backgroundColor = "#e84a01";
                                        sj.style.borderTop = "10px solid #e84a01";
                                    };
                                    div.onmouseleave = function(){
                                        this.style.backgroundColor = "#26b095";
                                        sj.style.borderTop = "10px solid #26b095";
                                    };
                                    var o = 0;
                                    var ul = document.createElement("div");
                                    div.onclick = function () {
                                        o++;
                                        $(this).siblings("div").children("div.hpanel").css("display","none");
                                        div.style.zIndex = "auto";
                                        $(this).siblings("div").css("zIndex","-10");
                                        if(o == 1){
                                            ul.className = "hpanel";
                                            ul.style.position = "absolute";
                                            ul.style.top = "0";
                                            ul.style.display = "block";
                                            var body = document.createElement("div");
                                            body.className = "panel-body list";
                                            body.style.overflowY = "scroll";
                                            var container = document.createElement("div");
                                            container.className = "list-item-container";
                                            container.style.maxHeight = "200px";
                                            div.appendChild(ul);
                                            body.appendChild(container);
                                            ul.appendChild(body);

                                            var allAreaResult = searchEstate.estateList;
                                            allAreaResult.forEach(function(data){
                                                data.forEach(function (data){
                                                    var item = document.createElement("div");
                                                    item.className = "list-item";
                                                    item.style.overflowX = "inherit";
                                                    var h3 = document.createElement("h3");
                                                    h3.className = "no-margins font-extra-bold text-success";
                                                    h3.style.fontSize = "12px";
                                                    if(data.cltv > 60 && data.cltv <= 80){
                                                        h3.style.color = "#FF9800";
                                                    }else if(data.cltv > 80 && data.cltv <= 100){
                                                        h3.style.color = "#E51C23";
                                                    }else if(data.cltv >= 100){
                                                        h3.style.color = "#8B1818";
                                                    }
                                                    h3.appendChild(document.createTextNode(data.sourceAddress));
                                                    item.appendChild(h3);
                                                    container.appendChild(item);
                                                    item.onclick = function () {
                                                        var href = window.location.origin + "/estate/mapShow/" + data.id;
                                                        window.open(href);
                                                    };
                                                })
                                            });
                                            ul.style.left = div.offsetWidth + "px";
                                        }else if(ul.style.display == "block"){
                                            ul.style.display = "none";
                                        }else{
                                            ul.style.display = "block"
                                        }
                                        ul.onmouseenter = function () {
                                            disableScroll(map);
                                        };
                                        ul.onmouseleave = function () {
                                            endisableScroll(map);
                                        };
                                    };
                                    map.getPanes().labelPane.appendChild(div);
                                    return div;
                                };
                                ComplexCustomOverlay.prototype.draw = function(){
                                    var map = this._map;
                                    var pixel = map.pointToOverlayPixel(this._point);
                                    this._div.style.left = pixel.x + "px";
                                    this._div.style.top  = pixel.y + "px";
                                };
                                var pt = new BMap.Point(searchEstate.lng,searchEstate.lat);
                                var areaResult = searchEstate.estateList[0].length + "笔";
                                myCompOverlay = new ComplexCustomOverlay(pt, areaResult);
                                map.addOverlay(myCompOverlay);
                            });
                        };
                        map.getPanes().labelPane.appendChild(div);
                        return div;
                    };
                    ComplexCustomOverlay.prototype.draw = function(){
                        var map = this._map;
                        var pixel = map.pointToOverlayPixel(this._point);
                        this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
                        this._div.style.top  = pixel.y - 30 + "px";
                    };
                    var pt = new BMap.Point(Community.lng,Community.lat);
                    //var count = Community.count + "笔";
                    myCompOverlay = new ComplexCustomOverlay(pt, Community.communityname, Community.count);
                    map.addOverlay(myCompOverlay);
                });
            };

            map.getPanes().labelPane.appendChild(div);

            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(data.lng,data.lat);
        var count = data.count + "笔";
        myCompOverlay = new ComplexCustomOverlay(pt, data.name, count);
        map.addOverlay(myCompOverlay);
    })
}
//添加小区覆盖物
function community () {
    clusterDate(Community);
    allAreaResult.forEach(function (Community) {
        //自定义小区覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.backgroundColor = "#26b095";
            div.style.color = "white";
            div.style.height = "60px";
            div.style.width = "60px";
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            div.style.zIndex = "-11";
            if(this._num < 5){
                div.style.backgroundColor = "#79ecd6";
            }else if(this._num >= 5 && this._num < 10) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(this._num >= 10 && this._num < 15) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var cont = document.createElement("div");
            cont.style.marginTop = "20%";
            var span = this._span = document.createElement("p");
            span.appendChild(document.createTextNode("笔"));
            span.style.margin = "0";
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.left = "17px";
            arrow.style.margin = "0";
            cont.appendChild(arrow);
            cont.appendChild(span);
            div.appendChild(cont);
            var message = document.createElement("div");
            message.style.width = "160px";
            message.style.height = "50px";
            message.style.background = "#FFFFFF";
            message.style.opacity = ".8";
            message.style.borderTopRightRadius = "25px";
            message.style.borderBottomRightRadius = "25px";
            message.style.position = "absolute";
            message.style.top = "5px";
            message.style.zIndex = "-10";
            message.style.color = "#666666";
            message.style.lineHeight = "50px";
            message.style.display = "none";
            message.style.textAlign = "center";
            message.style.border = "1px solid #e84a01";
            message.style.boxSizing = "border-box";
            message.style.left = "40px";
            message.style.fontSize = "14px";
            message.style.boxShadow = "0 0 6px #092923";
            message.appendChild(document.createTextNode(this._text));
            div.appendChild(message);
            arrow.appendChild(document.createTextNode(this._num));

            div.onmouseenter = function(){
                this.style.backgroundColor = "#e84a01";
                message.style.display = "block";
                this.style.zIndex = "auto";
                message.style.zIndex = "-10";
            };
            div.onmouseleave = function(){
                //this.style.backgroundColor = "#26b095";
                if(this.children[0].children[0].innerText < 5){
                    div.style.backgroundColor = "#79ecd6";
                }else if(this.children[0].children[0].innerText >= 5 && this.children[0].children[0].innerText < 10) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(this.children[0].children[0].innerText >= 10 && this.children[0].children[0].innerText < 15) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                message.style.display = "none";
                this.style.zIndex = "-11";
            };
            div.onclick = function() {
                map.clearOverlays();
                //map.removeOverlay();
                map.centerAndZoom(new BMap.Point(Community.lng, Community.lat),18);
                var communityId = {communityId:Community.communityid};
                clusterDate(searchEstate,communityId);
                allAreaResult.forEach(function (searchEstate) {
                    //自定义楼栋覆盖物
                    function ComplexCustomOverlay(point,num){
                        this._point = point;
                        this._num = num;
                    }
                    ComplexCustomOverlay.prototype = new BMap.Overlay();
                    ComplexCustomOverlay.prototype.initialize = function(map){
                        this._map = map;
                        var div = this._div = document.createElement("div");
                        div.style.position = "absolute";
                        div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
                        div.style.backgroundColor = "#26b095";
                        div.style.color = "white";
                        div.style.height = "30px";
                        div.style.lineHeight = "18px";
                        div.style.opacity = '0.9';
                        div.style.textAlign = "center";
                        div.style.borderRadius = "4px";
                        div.style.whiteSpace = "nowrap";
                        div.style.MozUserSelect = "none";
                        div.style.fontSize = "12px";
                        div.style.cursor = "pointer";
                        div.style.padding = "6px";
                        div.appendChild(document.createTextNode(this._num));
                        var sj = this._p = document.createElement("p");
                        sj.style.position = "absolute";
                        sj.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
                        sj.style.width = 0;
                        sj.style.height = 0;
                        sj.style.borderTop = "10px solid #26b095";
                        sj.style.borderLeft = "10px solid transparent";
                        sj.style.borderRight = "10px solid transparent";
                        sj.style.bottom = "-20px";
                        sj.style.left = "25%";
                        div.appendChild(sj);
                        div.onmouseenter = function(){
                            this.style.backgroundColor = "#e84a01";
                            sj.style.borderTop = "10px solid #e84a01";
                        };
                        div.onmouseleave = function(){
                            this.style.backgroundColor = "#26b095";
                            sj.style.borderTop = "10px solid #26b095";
                        };
                        var o = 0;
                        var ul = document.createElement("div");
                        div.onclick = function () {
                            o++;
                            $(this).siblings("div").children("div.hpanel").css("display","none");
                            div.style.zIndex = "auto";
                            $(this).siblings("div").css("zIndex","-10");
                            if(o == 1){
                                ul.className = "hpanel";
                                ul.style.position = "absolute";
                                ul.style.top = "0";
                                ul.style.display = "block";
                                var body = document.createElement("div");
                                body.className = "panel-body list";
                                body.style.overflowY = "scroll";
                                var container = document.createElement("div");
                                container.className = "list-item-container";
                                container.style.maxHeight = "200px";
                                div.appendChild(ul);
                                body.appendChild(container);
                                ul.appendChild(body);
                                var allAreaResult = searchEstate.estateList;

                                allAreaResult.forEach(function(data){
                                    data.forEach(function (data){
                                        var item = document.createElement("div");
                                        item.className = "list-item";
                                        item.style.overflowX = "inherit";
                                        var h3 = document.createElement("h3");
                                        h3.className = "no-margins font-extra-bold text-success";
                                        h3.style.fontSize = "12px";
                                        if(data.cltv > 60 && data.cltv <= 80){
                                            h3.style.color = "#FF9800";
                                        }else if(data.cltv > 80 && data.cltv <= 100){
                                            h3.style.color = "#E51C23";
                                        }else if(data.cltv >= 100){
                                            h3.style.color = "#8B1818";
                                        }
                                        h3.appendChild(document.createTextNode(data.sourceAddress));
                                        item.appendChild(h3);
                                        container.appendChild(item);
                                        item.onclick = function () {
                                            var href = window.location.origin + "/estate/mapShow/" + data.id;
                                            window.open(href);
                                        };
                                    })
                                });
                                ul.style.left = div.offsetWidth + "px";
                            }else if(ul.style.display == "block"){
                                ul.style.display = "none";
                            }else{
                                ul.style.display = "block"
                            }
                            ul.onmouseenter = function () {
                                disableScroll(map);
                            };
                            ul.onmouseleave = function () {
                                endisableScroll(map);
                            };
                        };
                        map.getPanes().labelPane.appendChild(div);
                        return div;
                    };
                    ComplexCustomOverlay.prototype.draw = function(){
                        var map = this._map;
                        var pixel = map.pointToOverlayPixel(this._point);
                        this._div.style.left = pixel.x + "px";
                        this._div.style.top  = pixel.y + "px";
                    };
                    var pt = new BMap.Point(searchEstate.lng,searchEstate.lat);
                    var areaResult = searchEstate.estateList[0].length + "笔";
                    myCompOverlay = new ComplexCustomOverlay(pt, areaResult);
                    map.addOverlay(myCompOverlay);
                });
            };

            map.getPanes().labelPane.appendChild(div);
            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(Community.lng,Community.lat);
       // var count = Community.count + "笔";
        myCompOverlay = new ComplexCustomOverlay(pt, Community.communityname, Community.count);
        map.addOverlay(myCompOverlay);
    });
}
//cityTab
function search(){
    //清空搜索
    $("#search").val("");
    $('#searchCommunity').html("");
    $('#searchCommunity').css('display','none');
    $('#district').val("");
    $('#risk').val("");
    $("#s2id_risk span:first").html("押品风险");
    $('#startDateStart').val("");
    $('#startDateEnd').val("");
    $('#buildArea').val("");
    $("#s2id_buildArea span:first").html("面积区段");
    $('#loansDuration').val("");
    $("#s2id_loansDuration span:first").html("抵押年限");
    // var s = $("#select2-chosen-1").text();
    // city.search(s); //查找城市
    var zoneNumber = $("#city").val();
    var cityName = $("#city").find("option:selected").text();
    //清除地图覆盖物
    map.clearOverlays();
    if((!zoneNumber || zoneNumber=="-1") && (!cityName || cityName=="请选择城市")){
        map.centerAndZoom(new BMap.Point(116.404, 39.915),12);
        return;
    }
    map.centerAndZoom(cityName,6);
    map.enableScrollWheelZoom(); // 允许滚轮缩放
    var zoneNumber = {city: zoneNumber};
    createCluste(zoneNumber);
}

map.addEventListener("zoomend",scrollFunc);
//监听地图层级
function scrollFunc (e) {
    e=e || window.event;
    var zoom = map.getZoom();
    if(zoom <= 15){
        map.clearOverlays();
        var zoneNumber = $("#city").val();
        var zoneNumber = {city: zoneNumber};
        createCluste(zoneNumber);
    }else if(zoom < 18 && zoom >16){
        if(flag == true){
            flag = false;
            return;
        }
        map.clearOverlays();
        community();
    }
}
function getBaiDu(name){
    var point = [];
    switch(name){
        //广州市行政区
        case '荔湾区':
            point=[113.243038,23.124943];
            break;
        case '越秀区':
            point=[113.280714,23.125624];
            break;
        case '黄埔区':
            point=[113.450761,23.103239];
            break;
        case '番禺区':
            point=[113.364619,22.938582];
            break;
        case '南沙区':
            point=[113.53738,22.794531];
            break;
        case '增城区':
            point=[113.829579,23.290497];
            break;
        case '从化区':
            point=[113.587386,23.545283];
            break;
        case '海珠区':
            point=[113.262008,23.103131];
            break;
        case '白云区':
            point=[113.262831,23.162281];
            break;
        case '花都区':
            point=[113.211184,23.39205];
            break;
        case '萝岗区':
            point=[113.243038,23.124943];
            break;
        case '天河区':
            point=[113.335367,23.13559];
            break;
        //杭州市行政区
        case '江干区':
            point=[120.218035,30.265712];
            break;
        case '西湖区':
            point=[120.135534,30.267209];
            break;
        case '余杭区':
            point=[120.308584,30.425534];
            break;
        case '桐庐县':
            point=[119.698599,29.797958];
            break;
        case '富阳区':
            point=[119.96076,30.051372];
            break;
        case '拱墅区':
            point=[120.145308,30.32658];
            break;
        case '萧山区':
            point=[120.273227,30.188074];
            break;
        case '建德市':
            point=[119.28267,29.504992];
            break;
        case '临安区':
            point=[119.720445,30.242252];
            break;
        case '下城区':
            point=[120.185839,30.293656];
            break;
        case '滨江区':
            point=[120.21861,30.215042];
            break;
        case '淳安县':
            point=[119.050404,29.621606];
            break;
        case '上城区':
            point=[120.174054,30.248242];
            break;
    }
    return point;
}